package com.hit.cmsService.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hit.cmsService.entity.CrmBanner;
import com.hit.cmsService.service.CrmBannerService;
import com.hit.commonUtils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//前台展示banner
@RestController
@RequestMapping("/cmsService/bannerFront")
@CrossOrigin
public class BannerFrontController {

    @Autowired
    private CrmBannerService crmBannerService;

    //@Cacheable(value = "banner",key="'selectIndexList'")
    @GetMapping("getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> list=crmBannerService.selectAllBanner();
        return R.ok().data("list",list);
    }
}
